package com.bestcem.xm.award.entity.mongo;

import com.bestcem.xm.award.enums.RecordFlagStatusEnum;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import java.io.Serializable;
import java.util.Date;

/**
 * mongo 实体基类, collection 通用字段 copy from txtanls
 * 注意跟其他模块的有区别，使用时需要特别注意
 *
 * @author sh.pei <sh.pei@idiaoyan.com>
 * @version v1.0
 * @date 2021/6/28 10:41
 */
@ToString
@Getter
@Setter
public abstract class BaseEntity implements Serializable {
    private static final long serialVersionUID = 8603603434168439276L;

    protected String id;

    /**
     * 数据记录标记
     *
     * @see RecordFlagStatusEnum
     */
    protected Integer recordFlag = 1;

    @CreatedDate
    @JsonProperty("create_time")
    protected Date createdDate;

    protected String createdId;

    @LastModifiedDate
    @JsonProperty("update_time")
    protected Date updatedDate;

    protected String updatedId;

}
